function createObject(o){
    function Fn(){}
    Fn.prototype = o
    return new Fn()
}


function inheritPrototype(SubType, SuperType) {
    SubType.prototype = Object.create(SuperType.prototype)
    Object.defineProperty(SubType.prototype, "constructor", {
        enumerable: false,
        configurable: true,
        writable: true,
        value: SubType
    })
}


function Person(name, age, friends) {
    this.name = name
    this.age = age
    this.friends = friends
}

Person.prototype.running = function () {
    console.log("running")
}

Person.prototype.eating = function () {
    console.log("eating")
}

function Student(name, age, friends, sno, score) {
    Person.call(this, name, age, friends)
    this.sno = sno,
    this.score = score
}

// Student.prototype = Object.create(Person.prototype)
// Object.defineProperty(Student.prototype,"constructor",{
//     enumerable:false,
//     configurable:true,
//     writable:true,
//     value:Student
// })
inheritPrototype(Student, Person)

Student.prototype.studying = function () {
    console.log("studying")
}

var stu1 = new Student("scott", 18, ["wenlin"], 111, 100)
console.log(stu1)
stu1.running()
stu1.studying()
stu1.eating()